import Vue from 'vue'
import Vuex from 'vuex'
import user from './module/user.js'
import app from './module/app.js'

Vue.use(Vuex)

let mapMutations = Vuex.mapMutations;

//修改商品添加页面步骤条的值
const CHANGE_PRODUCT_ADD_STEP = "activeProductAddStep";
const CHANGE_PRODUCT_ADD_DATA = "changeProductAddData";

export default new Vuex.Store({
	state:{
			activeProductAddStep: 0,
			productAddData: {
						  "albumPics": "",
						  "brandId": 6,
						  "brandName": "小米品牌",
						  "deleteStatus": 0,
						  "description": "string",
						  "detailDesc": "string",
						  "detailHtml": "string",
						  "detailMobileHtml": "",
						  "detailTitle": "",
						  "feightTemplateId": 0,
						  "giftGrowth": 0,
						  "giftPoint": 0,
						  "id": 0,
						  "keywords": "string",
						  "lowStock": 0,
						 "memberPriceList": [
						    // {
						    //   "id": 0,
						    //   "memberLevelId": 0,
						    //   "memberLevelName": "string",
						    //   "memberPrice": 0,
						    //   "productId": 0
						    // }
						  ], 
						  "name": "string",
						  "newStatus": 0,
						  "note": "string",
						  "originalPrice": 0,
						  "pic": "",
						  "prefrenceAreaProductRelationList": [
						    // {
						    //   "id": 0,
						    //   "prefrenceAreaId": 0,
						    //   "productId": 0
						    // }
						  ],
						  "previewStatus": 0,
						  "price": 0,
						  "productAttributeCategoryId": 5,
						  "productAttributeValueList": [
						    // {
						    //   "id": 0,
						    //   "productAttributeId": 0,
						    //   "productId": 0,
						    //   "value": "string"
						    // }
						  ],
						  "productCategoryId": 1,
						  "productCategoryName": "string",
						  "productFullReductionList": [
						    // {
						    //   "fullPrice": 0,
						    //   "id": 0,
						    //   "productId": 0,
						    //   "reducePrice": 0
						    // }
						  ],
						  "productLadderList": [
						    // {
						    //   "count": 0,
						    //   "discount": 0,
						    //   "id": 0,
						    //   "price": 0,
						    //   "productId": 0
						    // }
						  ],
						  "productSn": "888888",
						  "promotionEndTime": "",
						  "promotionPerLimit": 0,
						  "promotionPrice": 0,
						  "promotionStartTime": "",
						  "promotionType": 0,
						  "publishStatus": 0,
						  "recommandStatus": 0,
						  "sale": 0,
						  "serviceIds": "",
						  "skuStockList": [
						    // {
						    //   "id": 0,
						    //   "lockStock": 0,
						    //   "lowStock": 0,
						    //   "pic": "string",
						    //   "price": 0,
						    //   "productId": 0,
						    //   "promotionPrice": 0,
						    //   "sale": 0,
						    //   "skuCode": "string",
						    //   "spData": "string",
						    //   "stock": 0
						    // }
						  ],
						  "sort": 0,
						  "stock": 0,
						  "subTitle": "string",
						  "subjectProductRelationList": [
						    // {
						    //   "id": 0,
						    //   "productId": 0,
						    //   "subjectId": 0
						    // }
						  ],
						  "unit": "string",
						  "usePointLimit": 0,
						  "verifyStatus": 0,
						  "weight": 0
						}
		},
		mutations:{
			[CHANGE_PRODUCT_ADD_STEP](state, data) {
				state.activeProductAddStep = data;
			},
			[CHANGE_PRODUCT_ADD_DATA](state, data) {
				state.productAddData = data;
			}
		},
		actions:{
			
		},
		modules: {
			user,app
		}
	})